package org.dtrd.modules.record.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.dtrd.modules.record.entity.bean.AvgRecordBean;
import org.dtrd.modules.record.entity.po.DtrdEntRdSigninKetone;

import java.util.List;

public interface DtrdEntRdKetoneMapper extends BaseMapper<DtrdEntRdSigninKetone> {

    Integer countKetoneRecord(@Param("patientId") Integer patientId, @Param("startDate") String startDate, @Param("endDate") String endDate);

    Integer countKetoneNegative(@Param("patientId") Integer patientId, @Param("startDate") String startDate, @Param("endDate") String endDate);

    Integer countKetoneWeaklyPositive(@Param("patientId") Integer patientId, @Param("startDate") String startDate, @Param("endDate") String endDate);

    Integer countKetonePositive(@Param("patientId") Integer patientId, @Param("startDate") String startDate, @Param("endDate") String endDate);

    Integer countKetoneStronglyPositive(@Param("patientId") Integer patientId, @Param("startDate") String startDate, @Param("endDate") String endDate);

    List<DtrdEntRdSigninKetone> getAllGroupedKetoneRecord(Integer patientId, String startDate, String endDate, Integer pageStart, Integer pageSize);

    /**
     * 计算时间段内平均值
     * @param patientId
     * @param startDate
     * @param endDate
     * @return
     */
    AvgRecordBean getAvgValue(@Param("patientId") Integer patientId, @Param("startDate") String startDate, @Param("endDate") String endDate);
}